/*
 * @Author: calebman 
 * @Date: 2018-05-06 12:10:56 
 * @Last Modified by: calebman
 * @Last Modified time: 2018-05-14 10:14:21
 */


/**
* hidden: true                   如果hidden为true则不在左侧菜单栏展示，默认为false
* name:'router-name'             路由名称，必须填写
* meta : {
    roles: ['admin','editor']    权限列表，用于页面级的权限控制，默认不设置代表任何权限均可访问
    title: 'title'               对应路由在左侧菜单栏的标题名称
    icon: 'icon-class'             对应路由在左侧菜单栏的图标样式，样式使用iconfont图标库，见assest/iconfont文件夹
  }
**/

import login from '@/views/login';
import page404 from '@/views/error-page/404';
import page401 from '@/views/error-page/401';
import Message from '../component/Message';
import News from '../component/News';
import Messagedetails from '../component/Messagedetails';
import Luyou from '@/views/permission/luyou';
import Particulars from '@/views/permission/Particulars'
export const constantRouterMap = [
  { path: '/login', name: 'login', meta: { title: "系统登录", hidden: true }, component: login },
  { path: "/404", name: "page404", meta: { title: "页面走丢了", hidden: true }, component: page404 },
  { path: "/401", name: "page401", meta: { title: "权限不足", hidden: true }, component: page401 }
]


const layout = () => import(/* webpackChunkName: "group-index" */ '@/views/layout');
export const asyncRouterMap = [
  {
    path: '/',
    name: 'main',
    redirect: '/luyou',
    hidden: true,
    component: layout,
    children: [
      // { path: 'dashboard', name: 'dashboard', meta: { title: "仪表盘" }, component: () => import(/* webpackChunkName: "group-index" */'@/views/dashboard') }
      { path: "luyou", name: "luyou", meta: { title: "子路由" }, component: Luyou,
        children:[
        { path:'/luyou/message', name:"message", component: Message,
          children:[
            { path:'/luyou/message/detail/:id', name:"messagedetails", component: Messagedetails }
          ]
        },
        { path:'/luyou/news', name:"news", component: News }
        ] 
      },
      {
        path: "particulars", name: "particulars", meta: { title: "个人详情页" }, component: Particulars,
      }
    ]
  },
  {
    path: '/example',
    name: 'example',
    meta: { title: "组件", icon: "dbm d-icon-zujian" },
    redirect: '/example/menucarddemo',
    component: layout,
    children: [
      { path: "menucarddemo", name: "menuCardDemo", meta: { title: "菜单卡片", icon: "dbm d-icon-qiapian" }, component: () => import('@/views/demo/menu-card-demo') },
      { path: "treeviewdemo", name: "treeViewDemo", meta: { title: "树形结构", icon: "dbm d-icon-shu" }, component: () => import('@/views/demo/tree-view-demo') },
      { path: "datatabledemo", name: "dataTableDemo", meta: { title: "数据表格", icon: "dbm d-icon-biaoge" }, component: () => import('@/views/demo/datatable/data-table') },
      { path: "datatableform", name: "dataTableForm", meta: { title: "数据信息", icon: "iconfont icon-shuju" }, component: () => import('@/views/demo/datatable/data-form') },
      { path: "chartsdemo", name: "chartsDemo", meta: { title: "echarts图表", icon: "dbm d-icon-tubiao" }, component: () => import('@/views/demo/charts-demo') },
      { path: "test", name: "test", meta: { title: "布局测试", icon: "icon dbm d-icon-test" }, component: () => import('@/views/demo/layout-test') }
    ]
  },
  {
    path: '/permission',
    name: 'permission',
    meta: { title: "权限页", icon: "dbm d-icon-quanxian" },
    redirect: '/permission/elementpermission',
    component: layout,
    children: [
      { path: "adminpermission", name: "adminPermission", meta: { title: "个人核心信息", roles: ["admin","watcher"],icon:"iconfont icon-hexin" }, component: () => import('@/views/permission/admin') },
      { path: "watcherpermission", name: "watcherPermission", meta: { title: "人脸识别", roles: ["admin", "watcher"],icon:"iconfont icon-renlianshibie" }, component: () => import('@/views/permission/watcher') },
      { path: "elementpermission", name: "elementPermission", meta: { title: "数据信息", icon: "iconfont icon-shuju" }, component: () => import('@/views/permission/element') },
      { path: "datatablemy", name: "datatableMy", meta: { title: "表格数据", icon: "iconfont icon-biaogeshuju" }, component: () => import('@/views/permission/mydata') }
    ]
  },
  {
    path:'/personalcenter',
    name:'personalcenter',
    meta:{title:"个人中心",icon:"iconfont icon-ren"},
    redirect:'/personalcenter/center',
    component: layout,
    children:[
      { path: "hobby", name: "hobby", meta: { title: "爱好页", icon:"iconfont icon-aihao", roles: ["admin","watcher"] }, component: () => import('@/views/centre/hobby') },
      { path: "collect", name: "collect", meta: { title: "收藏页", icon:"iconfont icon-klmshoucang", roles: ["admin", "watcher"] }, component: () => import('@/views/centre/collect') },
      { path: "douban", name: "douban", meta: { title: "豆瓣电影", icon:"iconfont icon-dianyingb", roles: ["admin", "watcher"] }, component: () => import('@/views/douban/douban') },
      { path: "top250", name: "top250", meta: { title: "top250", icon:"iconfont icon-douban", roles: ["admin", "watcher"] }, component: () => import('@/views/douban/top250') },
    ]
  },
  {
    path: '/errorpage',
    name: 'errorpage',
    meta: { title: "错误页面", icon: "dbm d-icon-error" },
    redirect: '/errorpage/404',
    component: layout,
    children: [
      { path: "401", name: "unauthorized", meta: { title: "401页面", icon: "dbm d-icon-403" }, component: page401 },
      { path: "404", name: "pageNotFound", meta: { title: "404页面", icon: "dbm d-icon-msnui-404" }, component: page404 }
    ]
  },
  { path: '*', redirect: '/404', hidden: true }
]